README — Replication Package
Mind the gap: Partisan bias in justifying political violence in the United States

Version: 1.0 (2025-10-29)

This repository contains the data and code to reproduce all analyses, tables, and figures for the manuscript and appendix.

R script: replication script 
Data: SPSS .sav file (see “Data files”)
Expected runtime: 1–2 minutes on a standard laptop
Tested with R >= 4.0.0 (R 4.3.x on Windows/macOS)

Contents
Files in this dataset
Software requirements
Quick start (replication in three steps)
What the script produces
Data overview and variable dictionary (key fields)
Replication checks (key numbers to match)
Notes, conventions, and troubleshooting
Citation and licensing


1) Files in this dataset

Data
NO26467145_Power_of_Party_data_Final (1).sav (SPSS; primary analysis file)

Code
mind_the_gap_replication.R 
Documentation

Appendix


2) Software requirements
R >= 4.0.0
The script will install/load these packages if missing:
dplyr, haven, car, effectsize, pwr, broom, ggplot2, mgcv, emmeans, patchwork, tibble, officer, flextable
Internet access is required on first run to install CRAN packages.

3) Quick start (replication in three steps)
Place all files in one folder (the .sav data, the R script, and the documentation files).

Open the R script (mind_the_gap_replication.R) and edit the “USER CONFIGURATION” block at the top:

Set working directory:
Example: setwd("C:/Users/YourName/Documents/mind_the_gap")
Define the data file name (uncomment and match exactly, including spaces/parentheses):
Example:
data_filename <- "NO26467145_Power_of_Party_data_Final (1).sav"
Important: If you do not set data_filename, R will error with “object 'data_filename' not found”.

Run the entire script (e.g., Ctrl+Shift+Enter in RStudio). The script:

Imports and cleans data
Runs all main/exploratory analyses
Prints results to the console
Exports a Word file with all tables
Saves Figures 1 and 3 as PNGs

4) What the script produces
Console output

Descriptives (D1–D10)
Hypothesis tests H1–H3 (t-tests, ANOVAs), omnibus, factorial (Type III)
Interaction tests (script labels H5–H6, see note below)
Exploratory one-tailed χ² (E1–E3)
Post hoc power and MDES summaries (P1–P3)
Robustness (covariate-adjusted OLS; R0–R6)
Dark personality appendix models (DARK1–DARK5)
Files written to disk (working directory)

Appendix_ALL_Tables_YYYY-MM-DD.docx (single Word document containing all D/A/E/P/R/DARK tables)
Figure_1_H1_means.png
Figure_3_H3_means_severity.png
Note: Figure 2 is displayed in the session but not saved by default. To save it, add:
ggsave("Figure_2_H2_partisan_gap.png", Figure2, width=7.5, height=6, dpi=300)
5) Data overview and variable dictionary (key fields)
Unit of observation: Respondent

Inclusion for main analyses:

Attentive (QAttention == 4)
Partisans only (strong or moderate Democrats/Republicans; including leaners)
The script filters inattentive respondents and non-partisans
Primary raw variables used (SPSS labels may vary by export; names below reflect the .sav used in the script):

B1–B6: 7-point justifiability item from the six vignette conditions (1 = completely unjustified … 7 = completely justified)
QAttention: attention check (should equal 4 to pass)
A1/A2/A3: partisanship and strength (Dem/Rep vs. Independent/lean)
pid3: party family (1 = Democrat, 2 = Republican, 3 = Independent)
Q_Gender: gender
age: age in years
profile_gross_household: income category
race: race/ethnicity
C1_Dark_personality: single-item exploitation measure (1–7)
Constructed variables (in-script):

response: coalesced outcome from B1–B6 (the single 1–7 justifiability rating)
party_condition: factor with levels:
“No Party” (control vignette)
“Inparty” (victim = respondent’s party)
“Outparty” (victim = opposing party)
disruption_severity: “Mild” (shouting/screaming) vs. “Severe” (physical obstruction)
party_family: “Democrat” vs. “Republican”
partisanship: “Strong” vs. “Moderate” (strong identifiers vs. not very strong + leaners)
condone: binary (response >= 5)
age10: age/10 (for model scaling)
exploit_hi_67: indicator for exploitation 6–7
Weights: None (unweighted analyses, as per design; random assignment ensures internal validity of SATE).

6) Replication checks (key numbers to match)
After running the script, verify the following headline diagnostics (attentive partisans only):

N retained (attentive partisans): 1,521
Democrats: 898 (59%); Republicans: 623 (41%)
Strong vs. moderate partisans: ~55.2% vs. 44.8%

Cell sizes:
party_condition: No Party = 498; Inparty = 501; Outparty = 522
disruption_severity: Mild = 744; Severe = 777
H2 (Outparty > Inparty): mean gap ≈ 0.78 on 1–7 scale (t ≈ 7.10; p < .001)
H3 (Severe > Mild): mean gap ≈ 0.56 on 1–7 scale (t ≈ 6.1; p < .001)
H1 omnibus and 2×3 Type III: strong main effects; interaction ns
Exploratory “explicit condonance” (5–7) χ²:
Outparty − Inparty ≈ +13 pp overall; ≈ +18 pp among strong partisans
Minor differences at the third decimal may occur due to platform/package versions.

7) Notes, conventions, and troubleshooting
Hypothesis numbering alignment
Manuscript: H1–H5

Script:
“H5” = party_condition × severity (labelled H4)
“H6” = party_family × severity (labelled H5)
Dark-personality preregistered items appear as DH1/DH2 (script labels H4/H7 in the appendix section)
Data file name
Must match exactly, including spaces and parentheses:
data_filename <- "NO26467145_Power_of_Party_data_Final (1).sav"
Error “object 'data_filename' not found” means the line is still commented or unset.
Variable names
If your .sav uses different names (e.g., for pid3, Q_Gender, profile_gross_household, race, C1_Dark_personality), update the script in the “Data import, variable construction, cleaning” section to match your file.
Labelled variables
The script uses haven::as_factor to convert SPSS labelled fields; ensure haven is up to date.
Locale (Windows)
The script attempts to set a UTF-8 CTYPE locale on Windows; if a benign warning appears, you can ignore it.
Figures
Figures 1 and 3 are saved as PNG. Figure 2 is displayed; add a ggsave call if you want to export it.
Reproducibility
No random seeds are required; all estimates are deterministic given the input data.
Scope
Analyses are unweighted and restricted to attentive partisans, as described in the manuscript and appendix.
Ethics/IRB
The study was IRB-approved; see the appendix (screenshot included therein).

8) Citation and licensing

Berntzen, Lars Erik; Cappelen, Cornelius; Midtboe, Tor; Mason, Lilliana, 2025, "Replication Data for: Mind the gap: Partisan bias in justifying poliical violence in the United States", https://doi.org/10.7910/DVN/C2I1FK, Harvard Dataverse


Suggested paper citation:
Berntzen, Lars E., Cornelius Cappelen, Lilliana H. Mason and Tor Midtbø. (2025). Mind the gap: Partisan bias in justifying political violence in the United States. Public Opinion Quarterly, conditionally accepted.

License

Recommended: CC BY 4.0 for the dataset and code (update as appropriate for your deposit).

9) Contact
Corresponding author: Lars Erik Berntzen, Associate Professor at the Department of Government, University of Bergen. 
Email: lars.berntzen@uib.no
